var getXValueBarOption = function (title) {
    var option = {
        title: {
            text: title
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        xAxis: {
            type: 'value',
        },
        yAxis: {
            type: 'category',
            data: []
        },
        dataZoom: [//滑动条
            {
                yAxisIndex: 0,//这里是从X轴的0刻度开始
                show: true,//是否显示滑动条，不影响使用
                type: 'slider', // 这个 dataZoom 组件是 slider 型 dataZoom 组件
                startValue: 0, // 从头开始。
                endValue: 9  // 一次性展示6个。
            }
        ],
        grid: {
            left: '40px',
            bottom: '20px',
            top: '30px',
        },
        series: [
            {
                name: '待复诊人次',
                type: 'bar',
                label: {
                    show: true,
                    position: 'right', // 顶部显示
                    formatter: '{c}', // 显示数据值
                },
                data: []
            }
        ]
    };
    return option;
}

var getPieOption = function (title) {
    var option = {
        title:{
            text: title
        },
        legend: {
            top: 'bottom'
        },
        label: {
            formatter: function (data) {
                return data.value+'('+data.percent+'%)';
            },
            align: 'left', // 两端对齐
        },
        series: [
            {
                name: '分级情况',
                type: 'pie',
                radius: [30, 70],
                center: ['50%', '50%'],
                roseType: 'area',
                itemStyle: {
                    borderRadius: 8
                },
                labelLine: {
                    length: 10
                },
                data: []
            }
        ]
    };
    return option;
}


var getBarOption = function (title) {
    var option = {
        title:{
            text: title
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        xAxis: {
            type: 'category',
            axisLabel: {
               interval: 0,
               rotate: 30
            },
            data: []
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                data: [],
                type: 'bar',
                name: '复诊人次',
                label: {
                    show: true,
                    position: 'top',
                }
            }
        ]
    }
    return option;
};

var getLineOption = function (title) {
    var option = {
        title:{
            text: title
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        xAxis: {
            type: 'category',
            axisLabel: {
                interval: 0,
                rotate: 30
            },
            data: []
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                data: [],
                type: 'line',
                name: '复诊人次',
                label: {
                    show: true,
                    position: 'top',
                }
            }
        ]
    }
    return option;
};